package org.uam.exception;

/**
 * 
 * 异常操作工具类
 * <功能详细描述>
 * 
 * @author  Leo
 * @version  [版本号, 2012-10-31]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
public class ExceptionUtil
{
    /**
     * 抛出数据成功异常(Throw Data Access Exception)
     * @param exceptionMsg 消息
     * @see BaseException
     */
    public static void throwDASException(String exceptionMsg)
    {
        DASException exception = new DASException(exceptionMsg);
        throw exception;
    }
    
    /**
     * 抛出数据成功异常(Throw Data Access Exception)
     * @param cause 异常信息
     * @see BaseException
     */
    public static void throwDASException(Throwable cause)
    {
        DASException exception = new DASException(cause);
        throw exception;
    }
    
    /**
     * 抛出数据成功异常(Throw Data Access Exception)
     * @param exceptionMsg 消息
     * @param cause 异常信息
     * @see BaseException
     */
    public static void throwDASException(String exceptionMsg, Throwable cause)
    {
        DASException exception = new DASException(exceptionMsg, cause);
        throw exception;
    }
    
    /**
     * 抛出业务操作异常(Throw Business Exception)
     * @param exceptionMsg 消息
     * @see BaseException
     */
    public static void throwBusinessException(String exceptionMsg)
    {
        BusinessException exception = new BusinessException(exceptionMsg);
        throw exception;
    }
    
    /**
     * 抛出业务操作异常(Throw Business Exception)
     * @param cause 异常信息
     * @see BaseException
     */
    public static void throwBusinessException(Throwable cause)
    {
        BusinessException exception = new BusinessException(cause);
        throw exception;
    }
    
    /**
     * 抛出业务操作异常(Throw Business Exception)
     * @param exceptionMsg 消息
     * @param cause 异常信息
     * @see BaseException
     */
    public static void throwBusinessException(String exceptionMsg, Throwable cause)
    {
        BusinessException exception = new BusinessException(exceptionMsg, cause);
        throw exception;
    }
    
}
